class Admin::BaseSpicesController < ApplicationController
  # GET /admin/base_spices
  # GET /admin/base_spices.xml
  def index
    @base_spices = BaseSpice.find(:all)

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @base_spices }
    end
  end

  # GET /admin/base_spices/1
  # GET /admin/base_spices/1.xml
  def show
    @base_spice = BaseSpice.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @base_spice }
    end
  end

  # GET /admin/base_spices/new
  # GET /admin/base_spices/new.xml
  def new
    @base_spice = BaseSpice.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @base_spice }
    end
  end

  # GET /admin/base_spices/1/edit
  def edit
    @base_spice = BaseSpice.find(params[:id])
  end

  # POST /admin/base_spices
  # POST /admin/base_spices.xml
  def create
    @base_spice = BaseSpice.new(params[:base_spice])

    respond_to do |format|
      if @base_spice.save
        flash[:notice] = 'BaseSpice was successfully created.'
        format.html { redirect_to([:admin, @base_spice]) }
        format.xml  { render :xml => @base_spice, :status => :created, :location => @base_spice }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @base_spice.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /admin/base_spices/1
  # PUT /admin/base_spices/1.xml
  def update
    @base_spice = BaseSpice.find(params[:id])

    respond_to do |format|
      if @base_spice.update_attributes(params[:base_spice])
        flash[:notice] = 'BaseSpice was successfully updated.'
        format.html { redirect_to([:admin, @base_spice]) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @base_spice.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /admin/base_spices/1
  # DELETE /admin/base_spices/1.xml
  def destroy
    @base_spice = BaseSpice.find(params[:id])
    @base_spice.destroy

    respond_to do |format|
      format.html { redirect_to(admin_base_spices_url) }
      format.xml  { head :ok }
    end
  end
end
